/*
 * @Description:
 * @Version: 2.0
 * @Autor: wiz
 * @Date: 2023-08-16 17:36:20
 * @LastEditors: swc
 * @LastEditTime: 2024-06-18 19:20:02
 */
/* eslint-disable max-classes-per-file */
import { N_oSetupPanel } from '../../types';
import { T_compPanelConf } from '../compConfPanel';
import { T_compBase } from './compBase';

export class T_baseTabConf {
  status: string;

  isCreated: boolean;

  tabStyle: {
    type: 'card'; // Tab样式
    closable: boolean;
    animated: boolean;
  };

  panels: Array<any>;
}
export class T_baseTab extends T_compBase {
  private TcompPanelConf: T_compPanelConf = new T_compPanelConf();

  public conf: T_baseTabConf = {
    status: '',
    isCreated: false,
    tabStyle: {
      type: 'card',
      closable: false,
      animated: false
    },
    panels: []
  };

  public addPanels(...p: any[]): void {
    this.conf.panels.push(...p);
  }

  public getComponentId(): N_oSetupPanel.N_comps.COMP_MODULE_ID {
    // return N_oSetupPanel.N_comps.COMP_MODULE_ID.BASE_GRID;
    return N_oSetupPanel.N_comps.COMP_MODULE_ID.BASE_TAB;
  }

  public getConf(): T_baseTabConf {
    return this.conf;
  }

  public getPermissionList(
    config: T_baseTabConf
  ): Array<N_oSetupPanel.I_permission> {
    // 目前容器没有权限控制
    return [];
  }

  public GetCompPanelConf(): N_oSetupPanel.N_comps.I_setupPanel {
    return this.TcompPanelConf.getCompPanelSet(
      N_oSetupPanel.N_comps.COMP_NAME.BASE_TAB
    );
  }
}
